namespace Trauberman.SOChat.StarLeaderboard.Data.Migrations
{
    using System.Data.Entity.Migrations;
    
    public partial class InitialState : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "Users",
                c => new
                    {
                        SOid = c.Int(nullable: false),
                        Name = c.String(),
                    })
                .PrimaryKey(t => t.SOid);
            
            CreateTable(
                "StarredMessages",
                c => new
                    {
                        SOid = c.Int(nullable: false),
                        MessageText = c.String(),
                        StarCount = c.Int(nullable: false),
                        ChatRoom = c.Int(nullable: false),
                        User_SOid = c.Int(),
                    })
                .PrimaryKey(t => t.SOid)
                .ForeignKey("Users", t => t.User_SOid)
                .Index(t => t.User_SOid);
            
        }
        
        public override void Down()
        {
            DropIndex("StarredMessages", new[] { "User_SOid" });
            DropForeignKey("StarredMessages", "User_SOid", "Users");
            DropTable("StarredMessages");
            DropTable("Users");
        }
    }
}
